<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="username">请输入用户名:<input type="text" name ="username"></div>
    <div id="password">请输入密码：<input type="text" name="password"></div>
    <div><input type="checkbox">记住我</div>
    <button>登录</button>
<script>
        let btn = document.querySelector('button');
        btn.onclick = function(){
            let username = document.querySelector('input').value;
            let password = document.querySelectorAll('input')[1].value;
        }
        window.sessionStorage.setItem('input', username);
        window.sessionStorage.setItem('input', password);
        window.location.href = 'index.html';
</script>
</body>
</html>